1. Field of the Invention
The invention refers to a method and an apparatus for removing noise spikes from an electrical signal having an AC component.
2. Description of the Related Art
Electrical signals can comprise noise spikes causing disturbance during processing or use of the electrical signal. One example are noise spikes introduced by car engine""s electronic interference to radio amplitude modulated (AM) signals. Such noise spikes disturb the output signal of loudspeakers cooperating with an AM car radio.
In many applications it is desired to remove noise spikes.
U.S. Pat. No. 4,965,800 discloses a digital signal fault detector using a low voltage threshold and a high voltage threshold for discriminating binary low states and binary high states, respectively, and comprising a spike detector for detecting signal faults caused by spikes. It is assumed that typical non-spike pulses have a pulse time which is longer than a spike time. The spike detector comprises a low voltage threshold and a high voltage threshold for identifying the state of the input signal as low or high, a means for measuring the continuous duration in the low or the high state and for comparing it with the predetermined spike time, and a means for communicating the occurrence of a spike when the continuous duration of the signal in the low state or the high state is less than the spike time. The spike detector disclosed in U.S. Pat. No. 4,965,800 is not able to react on changes as regards the strength of the input signal. As a consequence, a weak input signal might be discriminated incorrectly and spikes might not be detected.
Such problems might be less serious in case of processing digital input signals which are to be discriminated as to having the low or the high state, only. The problem is, however, much more serious in case of amplitude modulated analog signals, e.g., AM radio signals.
Embodiments of the present invention aim at removing noise spikes from signals having variable strength, in particular from amplitude modulated analog signals.
Under a first aspect, the invention provides a method for determining the actual rms value of the input signal, low pass filtering the input signal, producing a variable offset, said variable offset being a function of the actual rms value, forming a variable threshold by superimposing the variable offset to the low pass filtered signal, comparing the input signal to the variable threshold, creating a spike detection signal when the input signal passes the variable threshold, and blanking the input signal during the occurrence of the spike detection signal.
By using a variable offset which is dependent on the actual rms value of the input signal and by forming a variable threshold obtained by superimposing the variable offset to a low pass filtered version of the input signal, the threshold and, in turn, the spike detection performance is adapted to a varying strength of the input signal. The threshold approximately follows the amplitude of the input signal with a certain distance therefrom, that does not follow spikes introduced to the input signal because of superimposing the variable offset not to the input signal itself but to the low pass filtered input signal. As a result, different from using a non-variable threshold, spikes can be safely detected irrespective of whether the actual strength of the input signal is high or low.
The removal of a detected noise spike is obtained by blanking the input signal during the occurrence of the spike detection signal.
Under a second aspect, the invention provides an apparatus for removing noise spikes from an electrical input signal having an AC component, comprising means designed for determining the actual rms value of the input signal, a low pass filter low pass filtering the input signal, an offset generator designed for producing a variable offset as a function of the actual rms value, superimposition means designed for forming a variable threshold by superimposing the variable offset to the low pass filtered signal, comparator means adapted for comparing the input signal to the variable threshold and for creating a spike detection signal when the input signal passes the variable threshold, and blanking means designed for blanking the input signal during the occurrence of the spike detection signal.
In an embodiment of the invention, the blanking time is made dependant on the actual rms, i.e. the actual strength of the input signal. Assuming that a spike has a shape which is independent from the shape and the strength of the input signal, the time period during which a detected spike is above (in case of positively directed spikes) or below (in case of negatively directed spikes) the input signal is larger for a weak input signal and is smaller for a strong input signal. This effect can be taken into consideration by making the blanking time dependant on the actual strength of the input signal.
In an embodiment of the invention, the blanked part of the input signal is replaced with an interpolated replacement signal, wherein the interpolated signal is obtained by taking the last input signal value before the blanking time and the first input signal value after the blanking time and by forming a ramp connecting these two input signal values.
If positive spikes are to be expected only, merely a high variable threshold is formed by adding to the input signal a positive variable offset and creating the spike detection signal when the input signal is above the variable high threshold. If negative spikes are to be expected only, merely a low variable threshold is formed by subtracting from the input signal a negative variable offset and creating the spike detection signal when the input signal is below the variable low threshold. If positive and negative spikes are to be expected, a high variable threshold as well as a low variable threshold are formed and the spike detection signal is created when the input signal is above the high variable threshold or below the low variable threshold.